home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
progjrn
/
pj_6_4.arc
/
SMLTPL.C
< prev
next >
Wrap
Text File
|
1988-04-28
|
1KB
|
59 lines
/*
Resident segment for the Windows small memory model template
*/
#include <windows.h>
#define EXTERN /* all global variables declared in this module */
#include "smltpl.h"
/* Entry point for program */
int PASCAL WinMain(hInstance, hPrevInstance, lpszCmdLine, cmdShow)
HANDLE hInstance, hPrevInstance;
LPSTR lpszCmdLine;
int cmdShow;
{
MSG msg;
/* If initialization is not successful then exit */
if (!InitProgram(hInstance,hPrevInstance, lpszCmdLine, cmdShow))
return FALSE;
/* Retrieve messages from Windows */
while (GetMessage((LPMSG)&msg,NULL,0,0)) {
TranslateMessage((LPMSG)&msg);
DispatchMessage((LPMSG)&msg);
}
return msg.wParam; /* exit program */
}
/* All messages are processed here */
long FAR PASCAL MainWndProc(hWnd,message,wParam,lParam)
HWND hWnd;
unsigned message;
WORD wParam;
LONG lParam;
{
PAINTSTRUCT ps;
switch(message) {
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_PAINT:
BeginPaint(hWnd, (LPPAINTSTRUCT)&ps);
EndPaint(hWnd, (LPPAINTSTRUCT)&ps);
break;
default:
return ((long)DefWindowProc(hWnd,message,wParam,lParam));
break;
}
return(0L);
}